import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useloginStore = defineStore('login', () => {
  const token = ref<string>('')
  const userinfo = ref<{
    expire:number
    jwt:string
    alc:string
  } | {}> ({})


  function settoken(data: string) {
    token.value = data
  }

  function setuserinfo(data: any) {
    userinfo.value = data
  }

  return { token, userinfo, settoken, setuserinfo }
})
